package com.FH.permission.sys_role_member;

import com.FH.util.ResultDTO;

import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

@Path("/sysrolemember")
@Produces(MediaType.APPLICATION_JSON)
@RequestScoped
public class SysRoleMemberResource {

    @EJB
    private SysRoleMemberDAO sysRoleMemberDAO;


    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    public ResultDTO addSysRoleMember(SysRoleMemberPullDTO sysRoleMemberPullDTO){
        return sysRoleMemberDAO.addSysRoleMember(sysRoleMemberPullDTO);
    }

    @POST
    @Path("updateCrp")
    @Consumes(MediaType.APPLICATION_JSON)
    public ResultDTO updateSysRoleMember(String str){
        return sysRoleMemberDAO.updateSysRoleMember(str);
    }

    @GET
    @Path("/{member_id}")
    public ResultDTO getUserRoleById(@PathParam("member_id") String member_id){
        return sysRoleMemberDAO.getUserRoleById(member_id);
    }
}
